﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WPLDB.DA.Interfaces.UI;
using System.ComponentModel.Composition;
using WPLDB.DA.Interfaces.UI.Base;
using WPLDB.DA.Interfaces.UI.Models;

namespace WPLDB.Package.UI.View
{
    /// <summary>
    /// Interaction logic for ChooseTablesView.xaml
    /// </summary>
    [Export(typeof(IChooseTablesView))]
    public partial class ChooseTablesView : UserControl, IChooseTablesView
    {
        #region "ctor"

        public ChooseTablesView()
        {
            InitializeComponent();
        }
        #endregion

        #region "Interface Implementation"

        public void SetViewModel(DA.Interfaces.UI.Base.IBaseViewModel viewModel)
        {
            this.DataContext = viewModel;
        }
        #endregion

        #region "Events"
        /// <summary>
        /// This event is catches from Tree view check box click.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void CheckBox_Click(object sender, RoutedEventArgs e)
        {
            ((IChooseTablesViewModel)this.DataContext).OnSelectedChanged(((IWPLDBString)((CheckBox)sender).CommandParameter));
        }
        #endregion

    }
}
